package com.hong.spring.log4j;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.logging.Logger;

public class MainApp {

   static Logger log = Logger.getLogger(MainApp.class.getName());

   public static void main(String[] args) {
      ApplicationContext context =
             new ClassPathXmlApplicationContext("log4j/log4j.xml");

      log.info("获取spring bean");

      Log4jHello obj = (Log4jHello) context.getBean("log4j");

      obj.getMessage();

      log.info("开始退出程序...");
   }
}